package com.sl.happying.reading.controller;


import com.sl.happying.reading.bean.Chapter;
import com.sl.happying.reading.service.ChapterService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@CrossOrigin
public class ChapterController {


    @Autowired
    private ChapterService chapterService;

    @ResponseBody
    @RequestMapping(value = "findByChapterName", method = RequestMethod.GET)
    public Chapter findByChapterName(String novelName, String chapterName){
       return chapterService.findByChapte(novelName, chapterName);
    }

}
